package leetcode.leetcode_3349;

import java.util.List;

class Solution {
    public boolean hasIncreasingSubarrays(List<Integer> nums, int k) {
        int n = nums.size();
        if (k == 1) {
            return true;
        }
        int left = 0;
        boolean flag = false;
        int index = 0;
        for (int i = 0; i < n - 1; i++) {
            if (nums.get(i) < nums.get(i + 1)) {
                index++;
            } else {
                index = 0;
            }
            if (index == k - 1 && flag) {
                if (i + 1 - left == k) {
                    return true;
                }
            }
            if (index == k - 1) {
                left = i + 1;
                flag = true;
                index = 0;
            }
        }
        return false;
    }

    public static void main(String[] args) {
//        [-15,-13,4,7]
        System.out.println(new Solution().hasIncreasingSubarrays(List.of(-15, -13, 4, 7), 2));
    }
}